home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-25 | 10.8 KB | 158 lines | [TEXT/PJMM] |
- {This is what is new in the new version of Hermes Toolbox}
-
- unit WhatsNew;
-
- interface
-
- {•••••••••••••••••••••••••••New in verion 0.8•••••••••••••••••••••••••••••}
-
- procedure DoTimeDialog (var hour, minute: integer);
- {-----------------------------------------------------------------------------------}
- {This procedure puts up a dialog similar to that which Hermes uses to enter the time for node}
- {start and end time. It gives the sysop the opportunity to enter time in a manner similar to}
- {that used by the Alarm Clock DA and General control panel. It returns the hour and minute}
- {that the sysop entered. The hour is in 24 hour format so 0 is midnight and 23 is 11 pm.}
- {Note that this dialog is modal so it will stop other action on the BBS, but this isn't really a}
- {problem since the sysop will use it rarely. If you use this function you MUST include all}
- {the resources included in the file with the same name as this function. Use ResEdit to copy}
- {them to your external's resource file. There is a text item in this dialog which can be used}
- {to prompt the user. You can either change it with ResEdit or call ParamText and set string}
- {number 0 to what you want displayed in that item.}
- {-----------------------------------------------------------------------------------}
-
- function StuffitExists: boolean;
- {-----------------------------------------------------------------------------------}
- {This function will check for the existence of the Stuffit Engine. The Stuffit Engine is}
- {supposed to be kept in the Extensions folder inside the System Folder. It returns true if the}
- {Engine is found and false if not. Most of the other Stuffit Functions call this one but you}
- {should still check before using any of them so you can report back to the user.}
- {-----------------------------------------------------------------------------------}
-
- function StuffFile (source, destination: str255; deleteOriginal: boolean): OSErr;
- {-----------------------------------------------------------------------------------}
- {This function will compress a single file using the Stuffit Engine which is part of the Stuffit}
- {Deluxe package. You should pass the path to the file to be compressed in source and where}
- {you want the archive to be placed in destination. If deleteOriginal is true then the file will}
- {be deleted after it has been compressed. This function does not add .sit to the end of the}
- {file name so if you are putting the new archive in the same directory you will need to add}
- {it yourself in the destination name. The fuction returns any OSErr that might take place}
- {and returns -1 if the user cancels the operation by hitting the stop button in the Stuffit}
- {Engine dialog. Although this function calls StuffitExists you should before calling it in order}
- {to report any errors to the user.}
- {-----------------------------------------------------------------------------------}
-
- function TouchFolder (folderPath: str255): OSErr;
- {-----------------------------------------------------------------------------------}
- {This procedure will chage the last modified date of a folder to the current time and date.}
- {This is often useful because it forces the Finder to update all the files in that folder. Pass}
- {it the path to the folder you want to change and it will return any error.}
- {-----------------------------------------------------------------------------------}
-
- procedure FlushAllVolumes;
- {-----------------------------------------------------------------------------------}
- {This procdure will cause all mounted volumes to be immeadiately flushed. All changes that}
- {have been made to files will be written to disk. This is important because the mac doesn't}
- {write to disk until the buffer is full. If you want to do something especially dangerous or}
- {something like shutdown the machine it might be a good idea to call this first.}
- {-----------------------------------------------------------------------------------}
-
- {•••••••••••••••••••••••••••New in verion 0.7•••••••••••••••••••••••••••••}
-
- function FindUserOnline (userNum: integer; var node: integer; HermSetup: UserXIPtr): boolean;
- {-----------------------------------------------------------------------------------}
- {This function will return true if the user specified by userNum is online. If true then the}
- {node that user is on will be returned in node.}
- {-----------------------------------------------------------------------------------}
-
- function NewUserAccount (var newUser: UserRec; HermSetup: UserXIPtr): OSErr;
- {-----------------------------------------------------------------------------------}
- {This function will create a new user on the BBS. You can pass a full user record or use}
- {WriteUser to flesh it out later. The new user's user number will be passed back in}
- {newUser.userNum.}
- {-----------------------------------------------------------------------------------}
-
- procedure CenterDialog (theDialog: DialogPtr);
- {-----------------------------------------------------------------------------------}
- {This procedure takes a dialog (or window) pointer (which you would get from GetNewDialog)}
- {and centers it on the screen. You should make your dialog 'initially invisable' and call this}
- {procedure BEFORE calling ShowWindow. Otherwise the user will see the dialog move across}
- {the screen.}
- {-----------------------------------------------------------------------------------}
-
- function DoRegistrationDialog (var bbsName: str255; var registrationNum: longInt): boolean;
- {-----------------------------------------------------------------------------------}
- {This function will put up a small dialog that will allow the sysop to enter basic registration}
- {information. The dialog has two items, one for a BBS name and one for a registration}
- {number. The function stores these two values in bbsName and registrationNum. The dialog}
- {also has two buttons, one for OK and one for cancel. The function will return true if the OK}
- {buttun is hit and false if cancel is hit. Note that this dialog is modal so it will stop other}
- {action on the BBS, but this isn't really a problem since the sysop will use it rarely. If you}
- {use this function you MUST include all the resources included in the file with the same name}
- {as this function. Use ResEdit to copy them to your external's resource file.}
- {-----------------------------------------------------------------------------------}
-
- function GetRegistration (var bbsName: str255; var registrationNum: longInt; resourceName: resType): boolean;
- {-----------------------------------------------------------------------------------}
- {This function will let you get saved registration information. It will retrieve the registration}
- {information in bbsName and registration number. You must pass the resourceName that you}
- {previously used to save the information. See SetRegistration for details. It will return true}
- {if it found the resource and false if it did not. If it did not find the resource you can create a}
- {new one by calling SetRegistration.}
- {-----------------------------------------------------------------------------------}
-
- procedure SetRegistration (bbsName: str255; registrationNum: longInt; resourceName: resType);
- {-----------------------------------------------------------------------------------}
- {This procedure will let you save registration information in your external's resource fork.}
- {Pass it the bbsName and registrationNum you want to save. You also need to pass a}
- {resource type name. This simply 4 letters (ie HRMS). Each external you write should have}
- {its own type though to avoid possible conflicts. Use the same type you use here as in}
- {GetRegistration.}
- {-----------------------------------------------------------------------------------}
-
- {•••••••••••••••••••••••••••New in verion 0.6•••••••••••••••••••••••••••••}
-
- function FindAndReplace (theString: Str255; oldString, newString: Str255): str255;
- {-----------------------------------------------------------------------------------}
- {This function takes theString and replaces the first occurance of oldString with newString}
- {and returns the resulting string.}
- {-----------------------------------------------------------------------------------}
-
- function FindAndReplaceAll (theString: Str255; oldString, newString: Str255): str255;
- {-----------------------------------------------------------------------------------}
- {This function takes theString and replaces the all occurances of oldString with newString}
- {and returns the resulting string.}
- {-----------------------------------------------------------------------------------}
-
- function CheckCard (cardNum: str255; visa, master, amex, discover: boolean): boolean;
- {-----------------------------------------------------------------------------------}
- {Yea, yea this is getting strange but I needed it so why not make it avaliable. This function}
- {will take a string representing a credit card number and will determine if the number is in}
- {the valid format. Pass true in the remaining varialbes for each type of credit card that is}
- {acceptable. In other words if you pass false for a varialbe that card type will not be }
- {considered valid. The cardNum string can have spaces although they are not necessary.}
- {All spaces will be ignored when evaluating the number. This function does three things.}
- {First, it checks the first number of the card for the credit card type and sees if that type}
- {is accepted. Second, it makes sure that the number is of the proper number of digits for}
- {each type. Third , it does a checksum on the number to see if it is a possible credit card}
- {number. This checksum is fairly involved and is not something you would want to do in}
- {your head but it is a good way to check cards. A number which passes these checks is}
- {not necessarily valid (ie it may not be assigned to anyone, stolen etc) but this is a good way}
- {to screen out fake numbers and mistakes.}
- {-----------------------------------------------------------------------------------}
-
- function CheckExpiration (expirationDate: str255): boolean;
- {-----------------------------------------------------------------------------------}
- {This function will take an expiration date (in the form MM/YY) and return whether this date}
- {has passed yet. With this and CheckCard, assuming the information is given truthfully, you}
- {can confirm the validity of a credit card immeadiately.}
- {-----------------------------------------------------------------------------------}
-
- procedure SetMouse (newPoint: Point);
- {-----------------------------------------------------------------------------------}
- {This procedure will set the cursor to newPoint. Why you would want to do this is beyond me}
- {but I had a reason to do so (the user doesn't ever notice). This is a really rude thing to do}
- {and is a good way to have an program which flops (people hate the mouse moving on them)}
- {-----------------------------------------------------------------------------------}
-
- implementation
- end.